<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <script src="http://localhost:8888/src/lib/ming_mock2.4.0.js"></script>
    <title>socket.io插件</title>
</head>
<body>

<button onclick="send2Server()">发送消息</button>
</body>
</html>

<script>
    //发消息
    function send2Server(){
        MIO.socketEmit("event",{
            name:"zs"
        })
    }


    app.installPlugin("http://localhost:8888/src/ming_mock_plugins/SocketIoWebPlugin.js",
        {
            key:"SocketIoWebPlugin",
            host:"",
            clientId:11,
            path:"mingdev/socket.io"
        },{
             //收消息
              callback:function (msg){
                  console.log("<====",msg)
              }
        })


</script>